package com.itheima.test1;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import org.junit.*;

@WebServlet(name = "com.itheima.test1.HelloWorld",urlPatterns = "/*")
public class HelloWorld  extends javax.servlet.http.HttpServlet{
    private String message = "helloworldhahahahhaah ";

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       resp.setContentType("text/html");
        PrintWriter out = resp.getWriter();
        out.println("<h1>"+message+"</h1>");
    }
}
